<?php
require_once('Extension/View/Helper/Abstract.php');

class Extension_View_Helper_U extends Extension_View_Helper_Abstract
{
    public function __construct() {
    }

    public function U($controller = null, $action = null, $module = null, 
        $params = array(), $routeName = null, $reset = false, $encode = true)
    {
        $url = '';
        if ($module !== null) {
            $arrayMain = array('module' => $module, 'controller' => $controller, 'action' => $action);
        } else {
            $arrayMain = array('controller' => $controller, 'action' => $action);
        }

        $arrayWithParams = array_merge($arrayMain, $params);
        $url = $this->view->url($arrayWithParams, $routeName, $reset, $encode);

        return $url;
    }
}